package com.castle.fortress.admin.cms.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 配置选值类型
 * @author  castle
 */
@Getter
@AllArgsConstructor
public enum ConfigValueTypeEnum {

    CONFIG_INPUT(1,"输入框数据","输入框数据"),
    CONFIG_CHECKBOX(2,"复选框数据","复选框数据"),
    CONFIG_VIDEO(3,"单选框数据","单选框数据"),
    CONFIG_LIST(4,"列表数据","列表数据"),
    CONFIG_IMAGE(5,"单图片数据","单图片数据"),
    CONFIG_IMAGE_LIST(6,"多图片数据","多图片数据"),
    ;

    Integer code;
    String name;
    String desc;

    public static String getNameByCode(Integer code){
        for(ConfigValueTypeEnum e: ConfigValueTypeEnum.values()){
            if(e.getCode().equals(code)){
                return e.getName();
            }
        }
        return null;
    }
}
